<form id="frmQuestions">
<br>QUESTIONS ACCEPTE<br><br>
<div id="idQuestions">
<?php

foreach ($data['toutesQuestions'] as $question){
	if ($question->getValidation()==1){
		echo "<br>".$question."   <a href='#' class='getReponses' id='idReponse".$question->getId()."'>Accéder au réponses</a>   <a href='#' class='supprimerQuestion' id='question".$question->getId()."'>Supprimer</a>    <a href='#'>Modifier</a><div id='message'></div>";
		echo "<div style='display:none' id='reponses".$question->getId()."'>";
		foreach ($data['reponsesByQuestions'] as $reponse){
			if($question==$reponse->getQuestion()){
				if($reponse->getEstBonne()==1){
					echo $reponse."(bonne)<br>";
				}
				else{
					echo $reponse."<br>";
				}
			}	
		}
		echo "<a href='#' id='cacheReponses".$question->getId()."'>Cacher les reponses</a>";
		echo "</div>";
		echo JsUtils::doSomeThingAndBindTo("#idReponse".$question->getId(), "click", "#reponses".$question->getId(),"show");
		echo JsUtils::doSomeThingAndBindTo("#cacheReponses".$question->getId(), "click", "#reponses".$question->getId(),"hide");
		
	}
}
?>
<br><br>QUESTION EN ATTENTE<br>
<?php 
foreach ($data['toutesQuestions'] as $question){
	if ($question->getValidation()==0){
		echo "<br>".$question." (ajoutée par ".$question->getJoueur().")  <a href='#' class='getReponses' id='idReponse".$question->getId()."'>Accéder au réponses</a>  <a href='#' class='question' id='question".$question->getId()."'>Valider cette question</a>  <a href='#'>Supprimer</a>    <a href='#'>Modifier</a><div id='message'></div>";
		echo "<div style='display:none' id='reponses".$question->getId()."'>";
		foreach ($data['reponsesByQuestions'] as $reponse){
			if($question==$reponse->getQuestion()){
				if($reponse->getEstBonne()==1){
					echo $reponse."(bonne)<br>";
				}
				else{
					echo $reponse."<br>";
				}
			}
		}
		echo "<a href='#' id='cacheReponses".$question->getId()."'>Cacher les reponses</a>";
		echo "</div>";
		echo JsUtils::doSomeThingAndBindTo("#idReponse".$question->getId(), "click", "#reponses".$question->getId(),"show");
		echo JsUtils::doSomeThingAndBindTo("#cacheReponses".$question->getId(), "click", "#reponses".$question->getId(),"hide");
		
	}
}
function afficheMessage($message){
	echo "<script>alert('".$message."');</script>";
	
}

//var_dump($data);
?>

<div class="tamere"><div class="msgBox"></div></div>
